<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>光大好车</title>
	<meta content="光大好车" name="keywords" />
	<meta content="光大好车" name="description" />
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="iconfont/iconfont.css">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/scroll.css">
	<script type="text/javascript" src="script/jquery.js"></script>
	<script type="text/javascript" src="script/bootstrap.min.js"></script>
	<script type="text/javascript" src="script/layer.js"></script>

	<link rel="stylesheet" href="css/news.css" />
	<link rel="stylesheet" href="css/style3.css" />
	<link rel="stylesheet" href="css/style4.css" />
	<link rel="stylesheet" type="text/css" href="css/style1.css">
	<script type="text/javascript" src="script/jquery-3.3.1.min.js"></script>
	<script type="text/javascript" src="script/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/scroll.js"></script>
	<!--<link rel="stylesheet" href="css/mui.min.css">-->
	<link rel="stylesheet" type="text/css" href="css/feedback-page.css" />

	<!--<script src="js/mui.min.js"></script>
		<script src="js/mui.js"></script>
		<script src="js/mui.picker.min.js"></script>
		<script src="js/mui.picker.js"></script>
		<script src='js/feedback.js'></script>
		<script src="js/app.js"></script>-->

	<link rel="stylesheet" href="css/demo.css" />

	<style>
		.line-limit-length {
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}

		.mui-bar {
			position: fixed;
			z-index: 10;
			right: 0;
			left: 0;
			height: 44px;
			padding-right: 10px;
			padding-left: 10px;
			border-bottom: 0;
			background-color: #f7f7f7;
			-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, .85);
			box-shadow: 0 0 1px rgba(0, 0, 0, .85);
			-webkit-backface-visibility: hidden;
			backface-visibility: hidden
		}

		.mui-bar-nav {
			top: 0;
			-webkit-box-shadow: 0 1px 6px #ccc;
			box-shadow: 0 1px 6px #ccc
		}

		.mui-bar1 {
			position: fixed;
			z-index: 10;
			right: 0;
			left: 0;
			height: 44px;
			padding-right: 10px;
			padding-left: 10px;
			border-bottom: 0;
			background-color: #f7f7f7;
			-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, .85);
			box-shadow: 0 0 1px rgba(0, 0, 0, .85);
			-webkit-backface-visibility: hidden;
			backface-visibility: hidden
		}

		.mui-bar-nav1 {
			top: 44px;
			-webkit-box-shadow: 0 1px 6px #ccc;
			box-shadow: 0 1px 6px #ccc
		}
	</style>


</head>

<body>
	<!--<div class="black_overlay"></div>-->
	<!--内容-->
	<header class="mui-bar mui-bar-nav mo-header" style="background-color: #00002E">
		<div class="mo-header-left">
			<a href="#">
				<font color="#F8F8F8">首页 </font>
			</a>
			<font color="#F8F8F8"><i class="mui-icon iconfont icon-youdayu"></i></font>
			<a href="#">
				<font color="#F8F8F8">买车 </font>
			</a>
		</div>
		<!--<div class="mo-header-right"> <a href="#"> 搜索 </a> </div>-->
	</header>

	<div class="mui-bar1 mui-bar-nav1 orderby-box clearfix ">
		<div class="order-item order-item-border line-limit-length">
			<a id="brandmodel" href="#" onclick="selectbrands(event)">品牌 <i
					class="mui-icon iconfont icon-xiadayu"></i></a>
		</div>
		<div class="order-item order-item-border line-limit-length">
			<a id="wholesaleprice" href="#" onclick="selectprice(event)">价格 <i
					class="mui-icon iconfont icon-xiadayu"></i></a>
		</div>
		<div class="order-item order-item-border" id="orderby">
			<a id="carage" href="#" onclick="selectcarages(event)">车龄 <i class="mui-icon iconfont icon-xiadayu"></i></a>
		</div>
		<div class="order-item">
			<a id="mains" href="#" onclick="selectmains(event)">综合<i class="mui-icon iconfont icon-xiadayu"></i></a>
		</div>
	</div>

	<div class="box">
		<div class="bcon">

			<!-- 代码开始 -->
			<!--<div class="list_lh" id="scroll">-->
			<!--<ul>
            <li>
                <p><a href="http://www.16sucai.com/" target="_blank">1000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
            </li>
            <li>
                <p><a href="http://www.16sucai.com/" target="_blank">2000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
            </li>
        </ul>-->
			<!--</div>-->
			<!-- 代码结束 -->
			<div class="roll-wrap roll_row" id="e">
				<ul class="roll__list" style="position: absolute; left: 0; top: 0;">
				</ul>
			</div>
		</div>

	</div>

	<!--<div class="carnum">为您找到 <span class="orange">106</span> 条车源</div>-->

	<div class="mui-content" id="form_info" style="padding-top: 60px;">
		<div id="listcar" style="padding-bottom: 20px;">

		</div>
		<!--<a href="javascript:;" class="nextpage">查看更多车源</a>-->
		<!--<a href="javascript:;" id="returntop"></a>-->
	</div>

	<div id="brand-box" class="brand-box" style="display: none;" onclick="selectbr(event)">
		<input type="hidden" name="brand" value="">
		<!--内容-->
		<header class="mo-header">
			<div class="mo-header-left">
				<a href="javascript:window.history.go(-1);" class="reback"> <i class="iconfont">&#xe647;</i> </a>
			</div>
			<div class="mo-header-title">选择品牌</div>
		</header>
		<div class="brandtitle"> * </div>
		<div id="A">
			<ul class="brandlist">
				<li>
					<a href="#" onclick="selectbrand('不限','')">不限品牌</a>
				</li>
			</ul>
		</div>
	</div>

	<!--选择价格==================================================================-->
	<div id="orderby-value" style="display: none;" onclick="selectp(event)">
		<input type="hidden" name="minPrice" value="">
		<input type="hidden" name="maxPrice" value="">
		<ul>
			<li>
				<a href="#" onclick="selectpri('','','不限')">不限</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('0','5','5万以下')">5万以下</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('5','10','5万-10万')">5万-10万</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('10','15','10万-15万')">10万-15万</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('15','20','15万-20万')">15万-20万</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('20','30','20万-30万')">20万-30万</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('30','50','30万-50万')">30万-50万</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('50','100','50万-100万')">50万-100万</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('100','150','100万-150万')">100万-150万</a>
			</li>
			<li>
				<a href="#" onclick="selectpri('200','100000','200万以上')">200万以上</a>
			</li>
		</ul>
	</div>
	<div id="orderby-carage" style="display: none;" onclick="selecta(event)">
		<input type="hidden" name="minCarAge" value="">
		<input type="hidden" name="maxCarAge" value="">
		<ul>
			<li>
				<a href="#" onclick="selectcarage('','','不限')">不限</a>
			</li>
			<li>
				<a href="#" onclick="selectcarage('0','1','1年以内')">1年以下</a>
			</li>
			<li>
				<a href="#" onclick="selectcarage('1','3','1-3年')">1-3年</a>
			</li>
			<li>
				<a href="#" onclick="selectcarage('3','5','3-5年')">3-5年</a>
			</li>
			<li>
				<a href="#" onclick="selectcarage('5','8','5-8年')">5-8年</a>
			</li>
			<li>
				<a href="#" onclick="selectcarage('8','10','8-10年')">8-10年</a>
			</li>
			<li>
				<a href="#" onclick="selectcarage('10','500','10年以上')">10年以上</a>
			</li>
		</ul>
	</div>

	<!--综合筛选=========================================================================-->
	<div id="maincontent" style="display: none;" onclick="selectm(event)">

		<div class="filter-box">
			<input type="hidden" name="cartype" value="">
			<div class="filter-title">类型</div>
			<ul class="filter-option-list clearfix">
				<li>
					<a href="javascript:;" onclick="selecttype('','不限')" class="option-item">不限</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selecttype('轿车','轿车')" class="option-item">轿车</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selecttype('SUV','SUV')" class="option-item">SUV</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selecttype('MPV','MPV')" class="option-item">MPV</a>
				</li>
			</ul>
		</div>

		<div class="filter-box">
			<input type="hidden" name="minMile" value="">
			<input type="hidden" name="maxMile" value="">
			<div class="filter-title">里程</div>
			<ul class="filter-option-list clearfix">
				<li>
					<a href="javascript:;" onclick="selectmile('', '', '不限')" class="option-item">不限</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectmile('0', '1', '1万公里以下')" class="option-item">1万公里以下</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectmile('1', '3', '1-3万公里')" class="option-item">1-3万公里</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectmile('3', '5', '3-5万公里')" class="option-item">3-5万公里</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectmile('5', '10', '5-10万公里')" class="option-item">5-10万公里</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectmile('10', '10000000', '不限')" class="option-item">10万公里以上</a>
				</li>
			</ul>
		</div>
		<div class="filter-box">
			<input type="hidden" name="transmission" value="">
			<div class="filter-title">变速箱</div>
			<ul class="filter-option-list clearfix">
				<li>
					<a href="javascript:;" onclick="selecttransm('', '不限')" class="option-item">不限</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selecttransm('自动', '自动')" class="option-item">自动</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selecttransm('手动', '手动')" class="option-item">手动</a>
				</li>
			</ul>
		</div>
		<div class="filter-box">
			<input type="hidden" name="minOutput" value="">
			<input type="hidden" name="maxOutput" value="">
			<div class="filter-title">排量</div>
			<ul class="filter-option-list clearfix">
				<li>
					<a href="javascript:;" data="" class="option-item">不限</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectoutput('0', '1.0', '1.0L以下')" class="option-item">1.0L以下</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectoutput('1.1', '1.5', '1.1-1.5L')"
						class="option-item">1.1-1.5L</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectoutput('1.6', '2.0', '1.6-2.0L')"
						class="option-item">1.6-2.0L</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectoutput('2.1', '3.0', '2.1-3.0L')"
						class="option-item">2.1-3.0L</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectoutput('3.0', '100', '3.0L及以上')"
						class="option-item">3.0L及以上</a>
				</li>
			</ul>
		</div>
		<div class="filter-box">
			<input type="hidden" name="emission" value="">
			<div class="filter-title">排放标准</div>
			<ul class="filter-option-list clearfix">
				<li>
					<a href="javascript:;" onclick="selectemis('', '不限')" class="option-item">不限</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectemis('国五', '国五')" class="option-item">国五</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectemis('国四', '国四')" class="option-item">国四</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectemis('国三', '国三')" class="option-item">国三</a>
				</li>
			</ul>
		</div>
		<div class="filter-box lastdiv">
			<input type="hidden" name="fuel" value="">
			<div class="filter-title">燃油类型</div>
			<ul class="filter-option-list clearfix">
				<li>
					<a href="javascript:;" onclick="selectfuel('', '不限')" class="option-item">不限</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectfuel('汽油', '汽油')" class="option-item">汽油</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectfuel('柴油', '柴油')" class="option-item">柴油</a>
				</li>
				<li>
					<a href="javascript:;" onclick="selectfuel('电力', '电力')" class="option-item">电力</a>
				</li>
			</ul>
		</div>
		<!--<div class="comfirm-box"></div>-->
		<div class="clearfix filter-menu" id="mainbutton">
			<a href="javascript:;" class="reset">重置</a>
			<a href="javascript:;" class="comfirm">确定</a>
		</div>
	</div>

	<script type="text/javascript" src="script/jquery.lazyload.js"></script>
	<!--<script src="js/mui.min.js"></script>-->
	<script src="js/mui.js"></script>
	<script src="js/mui.picker.min.js"></script>
	<script src="js/mui.picker.js"></script>
	<script src='js/feedback.js'></script>
	<script src="js/app.js"></script>
	<script>
		mui.back = function () {
			var btn = ["确定", "取消"];
			mui.confirm('确认关闭当前应用？', '提示', btn, function (e) {
				if (e.index == 0) {
					plus.runtime.quit();
				}
			});
		}
	</script>
	<script>
		$(document).click(function () {
			if ($("#brand-box").css("display") == "block") {
				$('#brand-box').hide();
				tof1 = !tof1;
			}
			if ($("#orderby-value").css("display") == "block") {
				$('#orderby-value').hide();
				tof2 = !tof2;
			}
			if ($("#orderby-carage").css("display") == "block") {
				$('#orderby-carage').hide();
				tof4 = !tof4;
			}
			if ($("#maincontent").css("display") == "block") {
				$('#maincontent').hide();
				tof3 = !tof3;
			}
		});

		function selectbr(event) {
			event.stopPropagation();
		}

		function selectp(event) {
			event.stopPropagation();
		}

		function selecta(event) {
			event.stopPropagation();
		}

		function selectm(event) {
			event.stopPropagation();
		}
	</script>
	<script type="text/javascript" charset="utf-8">
		function showdetail(id) {
			mui.openWindow({
				id: 'cardetail',
				url: 'cardetail.html',
				createNew: true,
				waiting: {
					autoShow: true,
					title: '正在加载...',
				},
				extras: {
					ids: id
				}
			});
		}
	</script>

	<script language="JavaScript">
		var brandmodel = '';
		var minyear = '';
		var maxyear = '';
		var minprice = '';
		var maxprice = '';
		var minage = '';
		var maxage = '';
		var cartype = '';
		var minmile = '';
		var maxmile = '';
		var transm = '';
		var minoutput = '';
		var maxoutput = '';
		var emission = '';
		var fuel = '';
		var tof1 = true;
		var tof2 = true;
		var tof3 = true;
		var tof4 = true;
		var flag;

		function getContent() {
			$.ajax({
				type: "post",
				url: servicePath + "sechandcar/app/scrolltext/findcontent",
				data: {},
				success: function (data) {
					var s = '<ul><li><p>' + data.content + '</p><li><ul>';
					var k = '<li>' + data.content + '</li>';
					$('#scroll').append(s);
					$('.roll__list').append(k);
				}
			});
		}

		var count = 0;
		var num = 0;
		var listlength = 0;
		var start = 0;
		(function ($, doc) {
			getContent();
			$.init({
				pullRefresh: {
					container: '.mui-content',
					up: {
						contentrefresh: '正在加载...',
						contentnomore: '没有更多数据了',
						callback: pullupRefresh
					}
				}
			});
			$.plusReady(function () {
				/*$("img.lazy").lazyload({
					effect: "fadeIn"
				});*/
				/*$('#returntop').click(function() {
					$('html,body').animate({
						scrollTop: '0px'
					}, 1000);
					return false;
				});*/

				var self = plus.webview.currentWebview();
				//获取前面页中的extras中的参数
				flag = self.flag;
				var url = servicePath + "sechandcar/app/sys/selectByWhere";
				mui.ajax(url, {
					//			        data:{productId:iid},  //把json转换为字符串
					dataType: 'json', //返回数据格式
					data: {
						brandmodel: brandmodel,
						//wholesaleprice:price,
						minprice: minprice,
						maxprice: maxprice,
						minage: minage,
						maxage: maxage,
						cartype: cartype,
						minmile: minmile,
						maxmile: maxmile,
						minoutput: minoutput,
						maxoutput: maxoutput,
						transmission: transm,
						fueltype: fuel,
						emissionstandard: emission
					},
					type: 'post', //请求方式
					async: false,
					contentType: "application/json", //处理中文乱码
					success: back0
				});

				$.ajax({
					url: servicePath + "sechandcar/app/sys/selectCarBrand",
					async: false,
					type: "post",
					dataType: "json",
					//data: {"id":$("input[name='id']").val()},
					data: {},
					success: function (data) {
						for (var i = 0; i < data.length; i++) {
							//var s = '<a href="#" onclick="selectbrand('+data[i].brandname+')">'+data[i].brandname+'</a>'

							var s = '<li class="onebrand" onclick="selectbrand(\'' + data[i]
								.brandname + '\')">' + data[i].brandname + '</li>';
							//alert(i);
							jQuery('.brandlist').append(s);
						}
					},
					error: function (data) {
						window.alert("删除失败");
						//window.alert(data);
					}
				});
			});


			function pullupRefresh() {
				setTimeout(function () {
					count++;
					$('.mui-content').pullRefresh().endPullupToRefresh(count > num); //参数为true代表没有更多数据了。

					if (flag) {
						var url = servicePath + "sechandcar/app/sys/selectByWhere";
						mui.ajax(url, {
							//data:'data='+JSON.stringify(data),  //把json转换为字符串
							data: {
								brandmodel: brandmodel,
								//wholesaleprice:price,
								minprice: minprice,
								maxprice: maxprice,
								minage: minage,
								maxage: maxage,
								cartype: cartype,
								minmile: minmile,
								maxmile: maxmile,
								minoutput: minoutput,
								maxoutput: maxoutput,
								transmission: transm,
								fueltype: fuel,
								emissionstandard: emission
							},
							dataType: 'json', //返回数据格式
							type: 'post', //请求方式
							contentType: "application/x-www-form-urlencoded; charset=utf-8", //处理中文乱码
							timeout: 5000, //超时时间设置，单位毫秒;访问失败就执行
							error: function (xhr, type, errorThrown) {
								mui.toast("网络连接超时啦~");
							},
							success: function (data) {
								console.log("第一个selectall方法");
								var lli = "";
								add(data);
							}
						});
					} else {
						jQuery("#brand-box").hide();
						document.getElementById('form_info').style.display = 'block';

						var url1 = servicePath + "sechandcar/app/sys/selectByWhere";
						mui.ajax(url1, {
							//			        data:{productId:iid},  //把json转换为字符串
							data: {
								brandmodel: brandmodel,
								//wholesaleprice:price,
								minprice: minprice,
								maxprice: maxprice,
								minage: minage,
								maxage: maxage,
								cartype: cartype,
								minmile: minmile,
								maxmile: maxmile,
								minoutput: minoutput,
								maxoutput: maxoutput,
								transmission: transm,
								fueltype: fuel,
								emissionstandard: emission

							},
							dataType: 'json', //返回数据格式
							type: 'post', //请求方式
							async: false,

							success: back1
						});
					}
				}, 500);
			}
		}(mui, document));

		function add(data) {
			console.log("add方法");
			var len = 0;
			for (var i = start; i < data.length; i++) {
				if (len < 10) {
					start++;
					len++;
					var s = '<div class="listcar">';
					var dz = "cardetail.html?id=" + data[i].id;
					s += '<a href="' + dz + '"><div class="listcar">' +

						'<div class="carimg"><img src="' + servicePath + '' + data[i].photo1 +
						'" data-original="img/carimg.jpg" class="img-responsive lazy" /> </div>' +
						'<div class="carinfo">' +
						'<h4>' + data[i].brandmodel + '</h4>' +
						'<p class="caritem">' + data[i].registrationdate + ' 上牌/ ' + data[i].mileage + '万公里</p>' +
						'<span class="carprice">￥' + data[i].wholesaleprice + '万元</span>' +
						'</div>' +

						'</div></a>';
					$('#listcar').append(s);
				}
			}
		}

		//$(function() {

		function back0(data) {
			console.log("第二个selectall方法的回调函数");
			listlength = data.length;
			if (listlength > 10) {
				num = Math.ceil((listlength - 10) / 10);
			}
			console.log("start" + start);
			console.log(data.length);
			if (data.length <= 10) {
				for (var i = 0; i < data.length; i++) {
					var s = '<div class="listcar">';
					var dz = "cardetail.html?id=" + data[i].id;
					s += '<a href="' + dz + '"><div class="listcar">' +

						'<div class="carimg"><img src="' + servicePath + '' + data[i].photo1 +
						'" data-original="img/carimg.jpg" class="img-responsive lazy" /> </div>' +
						'<div class="carinfo">' +
						'<h4>' + data[i].brandmodel + '</h4>' +
						'<p class="caritem">' + data[i].registrationdate + ' 上牌/ ' + data[i].mileage + '万公里</p>' +
						'<span class="carprice">￥' + data[i].wholesaleprice + '万元</span>' +
						'</div>' +

						'</div></a>';
					$('#listcar').append(s);
					start++;
				}
			} else if (data.length > 10) {
				for (var i = 0; i < 10; i++) {
					var s = '<div class="listcar">';
					var dz = "cardetail.html?id=" + data[i].id;
					s += '<a href="' + dz + '"><div class="listcar">' +

						'<div class="carimg"><img src="' + servicePath + '' + data[i].photo1 +
						'" data-original="img/carimg.jpg" class="img-responsive lazy" /> </div>' +
						'<div class="carinfo">' +
						'<h4>' + data[i].brandmodel + '</h4>' +
						'<p class="caritem">' + data[i].registrationdate + ' 上牌/ ' + data[i].mileage + '万公里</p>' +
						'<span class="carprice">￥' + data[i].wholesaleprice + '万元</span>' +
						'</div>' +

						'</div></a>';
					$('#listcar').append(s);
				}
				start = 10;
			}
		}

		function selecttype(data, value) {
			flag = false;
			cartype = data;
		}

		function selectmile(minmile1, maxmile1, value) {
			flag = false;
			minmile = minmile1;
			maxmile = maxmile1;
		}

		function selecttransm(data, value) {
			flag = false;
			transm = data;
		}

		function selectoutput(minoutput1, maxoutput1, value) {
			flag = false;
			minoutput = minoutput1;
			maxoutput = maxoutput1;
		}

		function selectemis(data, value) {
			flag = false;
			emission = data;
		}

		function selectfuel(data, value) {
			flag = false;
			fuel = data;
		}

		function selectprice(event) {
			if (tof2) {
				$('#maincontent').hide();
				$('#brand-box').hide();
				$("#orderby-carage").hide();
				$("#e").hide();
				$("#orderby-value").show();
				$("#form_info").show();
				//$(".mui-content").hide();
				event.stopPropagation();
			} else {
				$("#orderby-value").hide();
				$("#e").show();
			}
			tof2 = !tof2;
		}

		function selectcarages() {
			if (tof4) {
				$('#maincontent').hide();
				$('#brand-box').hide();
				$("#orderby-value").hide();
				$("#e").hide();
				$("#orderby-carage").show();
				$("#form_info").show();
				//$(".mui-content").hide();
				event.stopPropagation();
			} else {
				$("#orderby-carage").hide();
				$("#e").show();
			}
			tof4 = !tof4;
		}

		function selectbrands() {
			if (tof1) {
				$("#orderby-value").hide();
				$("#orderby-carage").hide();
				$('#maincontent').hide();
				$("#e").hide();
				$("#form_info").show();
				$("#brand-box").show();
				//$(".mui-content").hide();
				event.stopPropagation();
			} else {
				$("#brand-box").hide();
				$("#e").show();
			}
			tof1 = !tof1;
		}

		function selectbrand(value, imgurl) { //请求数据
			flag = false;
			$("#brand-box").hide();
			$(".mui-content").show();
			document.getElementById('form_info').style.display = 'block';
			$('#brandmodel').empty();
			$('#brandmodel').append(value);
			$("input[name=brand]").val(value);
			brandmodel = $("input[name=brand]").val();
			if (brandmodel == "不限") {
				brandmodel = '';
			}
			var url1 = servicePath + "sechandcar/app/sys/selectByWhere";
			mui.ajax(url1, {
				//			        data:{productId:iid},  //把json转换为字符串
				data: {
					brandmodel: brandmodel,
					//wholesaleprice:price,
					minprice: minprice,
					maxprice: maxprice,
					minage: minage,
					maxage: maxage,
					cartype: cartype,
					minmile: minmile,
					maxmile: maxmile,
					minoutput: minoutput,
					maxoutput: maxoutput,
					transmission: transm,
					fueltype: fuel,
					emissionstandard: emission

				},
				dataType: 'json', //返回数据格式
				type: 'post', //请求方式
				async: false,

				success: back1
			});
		}

		function selectpri(minprice1, maxprice1, value) { //请求数据
			flag = false;
			$('#form_info').show()
			$("#orderby-value").hide();
			$(".mui-content").show();
			$('#wholesaleprice').empty();
			$('#wholesaleprice').append(value);
			//$("input[name=price]").val(value);
			minprice = minprice1;
			maxprice = maxprice1;

			var url1 = servicePath + "sechandcar/app/sys/selectByWhere";
			mui.ajax(url1, {
				//			        data:{productId:iid},  //把json转换为字符串
				data: {
					brandmodel: brandmodel,
					//wholesaleprice:price,
					minprice: minprice,
					maxprice: maxprice,
					minage: minage,
					maxage: maxage,
					cartype: cartype,
					minmile: minmile,
					maxmile: maxmile,
					minoutput: minoutput,
					maxoutput: maxoutput,
					transmission: transm,
					fueltype: fuel,
					emissionstandard: emission

				},
				dataType: 'json', //返回数据格式
				type: 'post', //请求方式
				async: false,

				success: back1
			});
		}

		function selectcarage(minage1, maxage1, value) { //请求数据
			flag = false;
			$('#form_info').show();
			$("#orderby-carage").hide();
			$(".mui-content").show();
			$('#carage').empty();
			$('#carage').append(value);
			//$("input[name=price]").val(value);
			minage = minage1;
			maxage = maxage1;

			var url1 = servicePath + "sechandcar/app/sys/selectByWhere";
			mui.ajax(url1, {
				//			        data:{productId:iid},  //把json转换为字符串
				data: {
					brandmodel: brandmodel,
					//wholesaleprice:price,
					minprice: minprice,
					maxprice: maxprice,
					minage: minage,
					maxage: maxage,
					cartype: cartype,
					minmile: minmile,
					maxmile: maxmile,
					minoutput: minoutput,
					maxoutput: maxoutput,
					transmission: transm,
					fueltype: fuel,
					emissionstandard: emission

				},
				dataType: 'json', //返回数据格式
				type: 'post', //请求方式
				async: false,

				success: back1
			});
		}

		//============================================================================
		function selectmains() {
			if (tof3) {
				$('#brand-box').hide();
				$("#e").hide();
				$("#orderby-value").hide();
				$('#maincontent').show();
				$("#form_info").show();
				//$(".mui-content").hide();
				event.stopPropagation();
			} else {
				$("#maincontent").hide();
				$("#e").show();
			}
			tof3 = !tof3;
		}

		$(".onebrand").click(function () {
			var brandid = $(this).attr("data-index");
			$.get("#" + brandid, {}, function (data, textStatus) {
				$("#brand-data").show();
				$("#subbrand-data").html(data);
				$("#brand-box").hide();
			});
		});
		$("#reback").click(function () {
			$("#brand-box").show();
			$("#brand-data").hide();
		});
		$(".option-item").click(function () {
			var value = $(this).attr('data');
			$(this).addClass('selected').parent().siblings().children().removeClass('selected');
			$(this).parent().parent().siblings('input').val(value);
		});
		$(".comfirm").click(function () {
			$(".mui-content").show();
			if (flag == false) {
				$('#maincontent').hide();
				$('#form_info').show();

				var con = "";
				//品牌
				var url1 = servicePath + "sechandcar/app/sys/selectByWhere";
				mui.ajax(url1, {
					//			         data:{productId:iid},  //把json转换为字符串
					data: {
						brandmodel: brandmodel,
						//wholesaleprice:price,
						minprice: minprice,
						maxprice: maxprice,
						minage: minage,
						maxage: maxage,
						cartype: cartype,
						minmile: minmile,
						maxmile: maxmile,
						minoutput: minoutput,
						maxoutput: maxoutput,
						transmission: transm,
						fueltype: fuel,
						emissionstandard: emission

					},
					dataType: 'json', //返回数据格式
					type: 'post', //请求方式
					async: false,

					success: back1
				});
			} else {
				location.reload(true);
			}

		});
		$(".reset").click(function () {
			flag = true;
			$("input").attr("value", "");
			$(".option-item").removeClass('selected');
			$('#brandmodel').html("品牌");
			$('#wholesaleprice').html("价格");
			$('#carage').html("车龄");
			brandmodel = '';
			minprice = '';
			maxprice = '';
			minage = '';
			maxage = '';
			cartype = '';
			minmile = '';
			maxmile = '';
			transm = '';
			minoutput = '';
			maxoutput = '';
			emission = '';
			fuel = '';
		});
	</script>
	<script>
		function back1(data) {
			console.log("back1方法");
			$("#e").show();
			$('#listcar').empty();
			for (var i = 0; i < data.length; i++) {
				var s = '<div class="listcar">';
				var dz = "cardetail.html?id=" + data[i].id;
				s += '<a href="' + dz + '"><div class="listcar">' +

					'<div class="carimg"><img src="' + servicePath + '' + data[i].photo1 +
					'" data-original="img/carimg.jpg" class="img-responsive lazy" /> </div>' +
					'<div class="carinfo">' +
					'<h4>' + data[i].brandmodel + '</h4>' +
					'<p class="caritem">' + data[i].registrationdate + ' 上牌/ ' + data[i].mileage + '万公里</p>' +
					'<span class="carprice">￥' + data[i].wholesaleprice + '万元</span>' +
					'</div>' +

					'</div></a>';
				$('#listcar').append(s);
			}
		}
	</script>
	<script src="js/rollSlide.js"></script>
	<script>
		$('#e').rollNoInterval().left();
	</script>
</body>

</html>